#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>

int main()
{
  
 //int fd = open("log.txt",O_CREAT|O_WRONLY|O_TRUNC);
 int fd = open("log.txt",O_CREAT|O_WRONLY|O_APPEND);
 const char* s = "Hello World!\n";
  write(fd,s,strlen(s));



  //FILE* fp = fopen("log.txt","w");
  //if(fp==NULL)
  //{
  //  perror("fopen fail");
  //  return 1;
  //}
  //fputs("Hello World!\n",fp);
  return 0;
}
